package com.system.product.controller;

import com.system.product.domain.Product;
import com.system.product.domain.R;
import com.system.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/sys/product")
public class ProductController {

    @Autowired
    private ProductService productService;


    @RequestMapping("/list")
    private R list(){
        List<Product> list = productService.list();
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("productList",list);
        return R.ok(resultMap);
    }
}
